From 133eda8befe972b32d695d188d8634ac7144d477 Mon Sep 17 00:00:00 2001 From: oliskoli Date: Mon, 4 Dec 2006 23:46:41 +0000 Subject: [PATCH] Replace gpsbabel_now with gpsbabel_time (better for testo) and add a write check for "raymarine". --- raymarine.c | 11 +++++++---- testo | 3 +++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/raymarine.c b/raymarine.c index d6987ce31..810d5dea7 100644 --- a/raymarine.c +++ b/raymarine.c @@ -243,9 +243,9 @@ mkGUID(void) { guid_t res; - if (gpsbabel_now != 0) { - srand(gpsbabel_now + rand()); - res = ((guid_t) (gpsbabel_now) << 48) | + if (gpsbabel_time != 0) { + srand(gpsbabel_time + rand()); + res = ((guid_t) (gpsbabel_time) << 48) | ((guid_t)(rand() & 0xFFFF) << 32) | ((guid_t)(rand() & 0xFFFF) << 16) | (rand() & 0xFFFF); @@ -286,7 +286,10 @@ register_waypoint(const waypoint *wpt) if (items_in_depot >= size_of_depot) { size_of_depot+=16; - depot = (void *) xrealloc(depot, size_of_depot * sizeof(wpt)); + if (depot) + depot = (void *) xrealloc(depot, size_of_depot * sizeof(wpt)); + else + depot = (void *) xmalloc(size_of_depot * sizeof(wpt)); } depot[items_in_depot] = (waypoint *)wpt; diff --git a/testo b/testo index 8cf5b64f3..c36e5d26f 100755 --- a/testo +++ b/testo @@ -1155,6 +1155,9 @@ compare ${TMPDIR}/transform-wpt.gpx ${REFERENCE}/transform-wpt.gpx # ${PNAME} -i raymarine -f ${REFERENCE}/raymarine-sample.rwf -o gpx -F ${TMPDIR}/raymarine-sample.gpx compare ${TMPDIR}/raymarine-sample.gpx ${REFERENCE}/raymarine-sample.gpx +${PNAME} -i gpx -f ${REFERENCE}/expertgps.gpx -o raymarine -F ${TMPDIR}/expertgps.rwf +compare ${TMPDIR}/expertgps.rwf ${REFERENCE}/expertgps.rwf + exit 0 -- 2.30.2